interface requestTypes {
  url: string, method: | 'OPTIONS'
    | 'GET'
    | 'HEAD'
    | 'POST'
    | 'PUT'
    | 'DELETE'
    | 'TRACE'
    | 'CONNECT', data: any, contentType?: string
}
export const request = (params: requestTypes) => {
  const { url, method, contentType, data } = params;
  wx.request({
    url, method, header: { 'content-type': contentType || 'application/json' }, data, complete(res) {
      console.log(res);
    }
  })
}
  